get first entry in set java

48

get first entry in set java -

Set<Long> set = new LinkedHashSet<>();
set.iterator().next();
// LinkedHashSet guarantees insertion order

java list get first element -

set.iterator().next();

Comments

Submit
0 Comments